<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box{
            width: 300px;
            height: 300px;
            box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 20%);
            margin: auto;
            background-color: blueviolet;
        }
    </style>
</head>
<body>
    <button onclick="submit()">点我！！！</button>
    <button onclick="submitAll()">再点我！！！</button>
    <div  id="box">
        <input placeholder="看我">
    </div>
    <script>
        let box = document.querySelector("#box")
       function submit(){
           box.style.backgroundColor="pink";
        }
        function submitAll(){
            box.style.backgroundColor="blueviolet";
        }
        //    var year = prompt('请输入出生年月日');
        //    var age = 2022 -year;
        //     alert('年龄是'+ age +'岁')；
        // var first =prompt('请输入第一个值');
        // var last =prompt('请输入第二个值');
        // var value = parseFloat(first) + parseFloat(last)
        // alert('结果是'+value)
    let arr = "111.34hello 222 world 333";
    console.log( '不保留小数点parseInt====>',parseInt(arr),typeof parseInt(arr));//不保留小数点
    console.log( '保留小数点parseFloat====>',parseFloat(arr),typeof parseFloat(arr));//浮点数，保留小数点
    console.log('Boolean布尔值1返回true0返回false==>',Boolean(100));
     const num3 = 100;
     console.log('Boolean==> 0----->'+Boolean(0));
     let sum = Math.max(22,31,44,34,200);
     console.log("max===>",sum);
    //取下标对应的字符
    console.log('charAt=====>','hello world'.charAt(3));
     //替换replace
    let sun = 'hello word';
    let a = sun.replace('word','didi');
    console.log(a);
    // 对象

     var person = {
         name:'di',
         age:12,
         gender:'女'
     }
     var person1 = {
         name:'wu',
         age:13,
         gender:'男',
         fa:{
            mom:{
                name:'mpm',
                age:12
            }
         }
     }
     console.log("person===>",person);
    let str = "mom"
     console.log("person===>",person1.fa.mom.name);
     console.log("person===>",person1["fa"][str]["age"]);
    </script>
</body>
</html>